#!/bin/bash
root_dir="/usr/local/edata"
zk_proc=$(jps | grep "QuorumPeerMain" 2>&1)
if [[ $zk_proc == *"QuorumPeerMain"* ]];then
  echo "$(date +"%Y-%m-%d %H:%M:%S") WARNING zookeeper process detected,stop it first"
  exit 1
fi
rm -rf $root_dir/zk
if [[ $? -eq 0 ]];then
  echo "$(date +"%Y-%m-%d %H:%M:%S") INFO zookeeper uninstall success"
else
  echo "$(date +"%Y-%m-%d %H:%M:%S") ERROR zookeeper uninstall error"
fi
